package exercise;

public class EX02_Q16 {

	public static void main(String[] args) {
		// #16
		// a.
		int n = 1;
		int k = 2;
		int r = n;

		if (k < n)
			r = k;

		System.out.println("a. ");
		System.out.println("n = " + n);
		System.out.println("k = " + k);
		System.out.println("r = " + r);
		System.out.println("=================");

		// b.
		n = 1;
		k = 2;
		r = 0;

		if (n < k)
			r = k;
		else
			r = k + n;

		System.out.println("b. ");
		System.out.println("n = " + n);
		System.out.println("k = " + k);
		System.out.println("r = " + r);
		System.out.println("=================");

		// c.
		n = 1;
		k = 2;
		r = k;

		if (r < k)
			n = r;
		else
			k = n;

		System.out.println("c. ");
		System.out.println("n = " + n);
		System.out.println("k = " + k);
		System.out.println("r = " + r);
		System.out.println("=================");

		// d.
		n = 1;
		k = 2;
		r = 3;

		if (r < n + k)
			r = 2 * n;
		else
			k = 2 * r;

		System.out.println("d. ");
		System.out.println("n = " + n);
		System.out.println("k = " + k);
		System.out.println("r = " + r);
		System.out.println("=================");

	}

}
